package com.zyd.pojo;

/**
 * 微信小程序 返回实体类
 * bu给定状态默认是1 正常
 */
public class WeChatResult<T> {
    public static final Integer OK = 1;  //正常
    public static final Integer ERROR = -1;//不正常
    /**
     * 状态码
     */
    private Integer status;

    private T data;

    public WeChatResult(Integer status, T data) {
        this.status = status;
        this.data = data;
    }

    public WeChatResult(T data) {
        this.status = OK;
        this.data = data;
    }

    public WeChatResult() {
        this.status = OK;
    }

    @Override
    public String toString() {
        return "WeChatResult{" + "status='" + status + '\'' + ", data=" + data + '}';
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
